package cn.sunshine.framework.beans.factory;

import cn.sunshine.framework.beans.BeansException;
import cn.sunshine.framework.beans.factory.HierarchicalBeanFactory;
import cn.sunshine.framework.beans.factory.config.BeanPostProcessor;
import cn.sunshine.framework.beans.factory.config.SingletonBeanRegistry;

/**
 * @Description Configuration interface to be implemented by most bean factories. Provides
 * facilities to configure a bean factory, in addition to the bean factory
 * client methods in the {@link cn.sunshine.framework.beans.factory.BeanFactory}
 * interface.
 * @Author Mokairui
 * @Since 2021/12/11
 */
public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, SingletonBeanRegistry {

    String SCOPE_SINGLETON = "singleton";

    String SCOPE_PROTOTYPE = "prototype";

    void addBeanPostProcessor(BeanPostProcessor beanPostProcessor) throws BeansException;

    /**
     * 销毁单例对象
     */
    void destroySingletons();

}
